import { defineStore } from "pinia";

const useAlertStore = defineStore("alert", {
  state: () => ({ status: 0, message: "", show: false }),
  getters: {},
  actions: {
    submit(status, message) {
      this.status = status;
      this.message = message;
      this.show = true;

      setTimeout(() => {
        this.show = false;
      }, 2000);
    },

    x() {
      this.show = !this.show;
    },
  },
});

export default useAlertStore;
